package cn.changeforyou.generator.terminal;

/**
 * @author zhyu
 * @date 2021/1/30 15:04
 */
public class TerminalModel {
    
    private String word;
    private String value;
    private String key;
    
    private volatile boolean hasOk;

    public String getWord() {
        return word;
    }

    public void setWord(String word) {
        this.word = word;
    }

    public String getValue() throws InterruptedException {
        if(!hasOk) {
            this.wait();
        }
        return value;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public void setValue(String value) {
        if(!this.hasOk) {
            hasOk = true;
            this.notify();
        }
        this.value = value;
    }
}
